﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Buccontrols;
using PluginInterface;
using Buccaneer;
using TestingApplication;

namespace NotepadPlugin
{
    public class Plugin : IPlugin
    {
        string myPluginName = "NotepadPlugin";
        string myPluginDescription = "Write, edit and save documents.";
        string myPluginAuthor = "Adriaan Bijl";
        string myPluginVersion = "1.0.0";
        string myPluginPath;
        IPluginHost myHost;
        NotePad myMainInterface = new NotePad();
        Dictionary<string, PluginAction> myMenuActions = new Dictionary<string, PluginAction>();
        Dictionary<string, PluginAction> myActionFunctions = new Dictionary<string, PluginAction>();

        public void Initialize()
        {
            this.myMenuActions.Add("open", new OpenAction(this));
            this.myMenuActions.Add("save", new SaveAction(this));
            this.myMenuActions.Add("close", new CloseAction(this));
        }

        public void Dispose()
        {
            // deze functie wordt aangeroepen als de plugin gesloten wordt.
        }

        public void Activate()
        {

        }

        public string Name
        {
            get { return this.myPluginName; }
        }

        public string Description
        {
            get { return this.myPluginDescription; }
        }

        public string Author
        {
            get { return this.myPluginAuthor; }
        }

        public string Version
        {
            get { return this.myPluginVersion; }
        }

        public string Path
        {
            get { return this.myPluginPath; }
            set { this.myPluginPath = value; }
        }

        public IPluginHost Host
        {
            get { return this.myHost; }
            set { this.myHost = value; }
        }

        public PluginForm MainInterface
        {
            get { return this.myMainInterface; }
            set { this.myMainInterface = value as NotePad; }
        }

        public PluginDaddy Daddy
        {
            get { return this.myMainInterface.Daddy as PluginDaddy; }
            set { this.myMainInterface.Daddy = value; }
        }

        public Dictionary<string, PluginAction> MenuActions
        {
            get { return this.myMenuActions; }
            set { this.myMenuActions = value; }
        }

        public Dictionary<string, PluginAction> ActionFunctions
        {
            get { return this.myActionFunctions; }
        }


    }

}
